#!/bin/env python

import time
import cv2
import numpy as np

pic_path = "../resource/pic/img_002.jpg"
windowName = pic_path

# cv2.namedWindow(windowName, cv2.WINDOW_NORMAL)
# cv2.resizeWindow(windowName, 640, 480)
pic = cv2.imread(pic_path)

print("shape:", pic.shape)
print("size:", pic.size)
print("dtype:", pic.dtype)

b,g,r = cv2.split(pic)

b[10:100, 10:100] = 255
g[10:100, 10:100] = 255

img2 = cv2.merge((b,g,r))

cv2.imshow("bgr", np.hstack((b, g, r)))
cv2.imshow(windowName, np.hstack((pic, img2)))

while True:
    if cv2.waitKey(0) == ord('q'):
        break

print('销毁窗口')
cv2.destroyAllWindows()